import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;

public class Fast {

	public static void main(String[] args) {
		In in = new In(args[0]);      // input file
        int N = in.readInt();         // number of points N
		StdDraw.setXscale(0, 32768);
		StdDraw.setYscale(0, 32768);
		
        // repeatedly read in sites to open and draw resulting system
        Point[] points = new Point[N];
        
        int i = 0;
        while (!in.isEmpty()) {
            int x = in.readInt();
            int y = in.readInt();
            Point point = new Point(x, y);
            points[i] = point;
            i++;
        }
        
        Point[] unchangingPoints = new Point[N];
        HashMap<Point, ArrayList<Double>> establishedLines = new HashMap<Point, ArrayList<Double>>();
        
        Merge.sort(points);
        
        //copying points to an unchanging array.
        for (int x = 0; x < N; x++)
        	unchangingPoints[x] = points[x];
        
        for (Point p: unchangingPoints) {
        	
        	Arrays.sort(points, p.SLOPE_ORDER);
        	int end = 0;
        	int count = 0;
        	int flag = 0;
        	double slope = 0;

        	for (int x = 1; x < N; x++) {

        		if (p.slopeTo(points[x]) == p.slopeTo(points[x-1])) {
        			flag = 1;
        			count++;
        			end = x;
        			slope = p.slopeTo(points[x]);
        			if (x < N-1)
        				continue;
        		}
        	
        		if (flag == 1 && count <= 1) {
        			count = 0;
        			flag = 0;
        			continue;
        		}
        		
        		if (flag == 1 && count > 1) {
        			if (!establishedLines.containsKey(p)) {
        				establishedLines.put(p, new ArrayList<Double>());
        				establishedLines.get(p).add(Double.valueOf(slope));
        			}
        			else
        				establishedLines.get(p).add(Double.valueOf(slope));

	        		int start = end - count;
	        		int skip = 0;
	        		
	        		outerLoop: for (int index1 = 0; index1 < count + 1; index1++) {
	        			ArrayList<Double> list = establishedLines.get(points[start + index1]);
	        			if (list != null)
		        			for (Double slope1: list) {
		        				if (slope1 != null)
			    					if (p.slopeTo(points[start + index1]) == slope1.doubleValue()) {
			    						skip = 1;
		        						break outerLoop;
			    					}
		        			}
	        		}
		        		
	        		if (skip == 0) {
		        		StdOut.print(p.toString() + " -> ");
		        		Arrays.sort(points, start, start+count+1);
		        		
		        		for (int index = 0; index < count + 1; index++)
		        			if (index < count) {
		        				StdOut.print(points[start + index].toString() + " -> ");
		        				points[start + index].draw();
		        			}
		        			else {
		        				StdOut.println(points[start + index].toString());
		        				points[start + index].draw();
		        				points[start + index].drawTo(p);
		        			}
	        		}
	        		
        			count = 0;
        			flag = 0;
        		}
        		

        	}
        		
        }
        	

	}

}
